<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>广东国防教育学会</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css" />
		<link rel="stylesheet" href="http://idangero.us/swiper/dist/css/swiper.min.css" />
		<link rel="stylesheet" href="/Public/Home/activity/css/style.css" />
	</head>
	<body>

	<nav class="bar bar-tab">
			<a class="tab-item open-indicator <?php if($active == 'home'): ?>active<?php endif; ?>"  href="/">
				<span class="icon icon-home"></span>
				<span class="tab-label">首页</span>
			</a>
			<a class="tab-item open-indicator" href="<?php echo U('Apply/apply');?>">
				<span class="icon iconfont icon-category"></span>
				<span class="tab-label">专家预约</span>
			</a>
			<a class="tab-item open-indicator" <?php if($active == 'user_company'): ?>active<?php endif; ?>" href="<?php echo U('UserCompany/index');?>">
				<span class="icon iconfont icon-huiyuan1"></span>
				<span class="tab-label">会员单位</span>
			</a>
			<a class="tab-item open-indicator <?php if($active == 'user'): ?>active<?php endif; ?>" href="<?php echo U('Users/index');?>">
				<span class="icon iconfont icon-account"></span>
				<span class="tab-label">我的</span>
			</a>
		</nav>		

		<div class="page page-current" id="order">
			<div class="bar bar-nav">
				<h1 class="title">订单列表</h1>
				<i class="icon icon-left" onclick="window.history.go(-1);"></i>
			</div>
			
			<div class="content">
			<div class="buttons-tab fixed-tab" data-offset="34" style="margin-top:10px;">
				<a class="tab-link button active" href="#order_1">全部</a>
				<a class="tab-link button" href="#order_2">待付款</a>
				<a class="tab-link button" href="#order_3">待参与</a>
				<a class="tab-link button" href="#order_4">已完成</a>
				<a class="tab-link button" href="#order_5">已取消</a>
			</div>
			<div class="tabs">
				<div class="tab active" id="order_1">
				<?php if($all_show): ?><div style="text-align:center;"><a style="font-size:12px;border-bottom:1px solid #ddd;line-height:20px;display:inline-block;margin-bottom: 10px;">我有<?php echo ($all_count); ?>个订单</a></div><?php endif; ?>
				<div id="all_activity">
				  <?php if(is_array($all)): foreach($all as $k=>$all): ?><div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> <?php echo ($all['sponsor']); ?></span>
					  <a>
					  	 <?php if($all['order_status'] == 1): ?>待付款
					  	 <?php elseif($all['order_status'] == 2): ?>待参与
					  	 <?php elseif($all['order_status'] == 3): ?>已完成<?php endif; ?>
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="<?php echo U('orderDetail',array('order_id'=>$all['id']));?>">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="<?php echo ($all['activity_img']); ?>" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title"><?php echo ($all['activity_name']); ?></div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo ($all['area']); ?>&nbsp;&nbsp;&nbsp;<?php echo ($all['signup_number']); ?>人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo (date("Y-m-d",$all['start_time'])); ?> 至 <?php echo (date("Y-m-d",$all['end_time'])); ?></p>
					          </div>
					        </li>
					      </ul>
					    </div>
					   </a> 
					  </div>
					  <div class="card-footer"><span>￥<font><?php echo ($all['amount']); ?></font></span>
					  <span>
					  <?php if($all['order_status'] == 1): ?><form action="<?php echo U('Wxpay/js_api_call');?>" method="post" style="display: inline-block;">
					  	<input type="hidden" name="order_sn" value="<?php echo ($all['order_sn']); ?>" />	
					  	<button type="submit"  style="display: inline-block;" class="button button-fill" >去付款</button>
					  </form>
					  <a style="display: inline-block;" href="<?php echo U('cancelOrder',array('order_id'=>$all['id']));?>" class="button button-fill" >取消订单</a>
					  <?php elseif($all['order_status'] == 2): ?>
					  <a style="display: inline-block;" href="<?php echo U('electronics',array('order_id'=>$all['id']));?>" class="button button-fill" >查看电子票</a>
					  <?php elseif($all['order_status'] == 3): ?>
					  <a style="display: inline-block;" href="<?php echo U('Users/orderDetail',array('order_id'=>$all['id']));?>" class="button button-fill">已完成</a>
					  <?php elseif($all['order_status'] == 4): ?>
					  <a style="display: inline-block;" href="<?php echo U('Users/orderDetail',array('order_id'=>$all['id']));?>" class="button button-fill">已取消</a><?php endif; ?>
					  </span>
					  </div>
					</div><?php endforeach; endif; ?>
				</div>
					<?php if($all_show): ?><div class="infinite-scroll-preloader" id="all_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_submit();" class="all_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					<?php else: ?>
					<p id="load_more"> 暂无数据！</p><?php endif; ?>
				</div>
			
			 		
		
			
			<div class="tab" id="order_2">
			<div id="stay_activity">
					<?php if(is_array($stay)): foreach($stay as $k=>$stay): ?><div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> <?php echo ($stay['sponsor']); ?></span>
					  <a>
					  	 待付款
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="<?php echo U('orderDetail',array('order_id'=>$stay['id']));?>">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="<?php echo ($stay['activity_img']); ?>" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title"><?php echo ($stay['activity_name']); ?></div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo ($stay['area']); ?>&nbsp;&nbsp;&nbsp;<?php echo ($stay['signup_number']); ?>人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo (date("Y-m-d",$stay['start_time'])); ?> 至 <?php echo (date("Y-m-d",$stay['end_time'])); ?></p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font><?php echo ($stay['amount']); ?></font></span>
					  <span>
					  <form action="<?php echo U('Wxpay/js_api_call');?>" method="post" style="display: inline-block;">
					  	<input type="hidden" name="order_sn" value="<?php echo ($stay['order_sn']); ?>" />	
					  	<button type="submit"  style="display: inline-block;" class="button button-fill" >去付款</button>
					  </form>
					  <a style="display: inline-block;" href="<?php echo U('cancelOrder',array('order_id'=>$stay['id']));?>" class="button button-fill" >取消订单</a>
					  </span>
					  </div>
					</div><?php endforeach; endif; ?>
			 </div>
			 		<?php if($stay_show): ?><div class="infinite-scroll-preloader" id="stay_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_stay_submit();" class="stay_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					<?php else: ?>
					<p id="load_more"> 暂无数据！</p><?php endif; ?>
			</div>
					
			
			
			
			<div class="tab" id="order_3">
				<div id="not_activity">
					<?php if(is_array($stay_participate)): foreach($stay_participate as $k=>$stay_participate): ?><div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> <?php echo ($stay_participate['sponsor']); ?></span>
					  <a>
					  	 待参与
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="<?php echo U('orderDetail',array('order_id'=>$stay_participate['id']));?>">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="<?php echo ($stay_participate['activity_img']); ?>" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title"><?php echo ($stay_participate['activity_name']); ?></div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo ($stay_participate['area']); ?>&nbsp;&nbsp;&nbsp;<?php echo ($stay_participate['signup_number']); ?>人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo (date("Y-m-d",$stay_participate['start_time'])); ?> 至 <?php echo (date("Y-m-d",$stay_participate['end_time'])); ?></p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font><?php echo ($stay_participate['amount']); ?></font></span>
					  <span>
					  <a href="<?php echo U('electronics',array('order_id'=>$stay_participate['id']));?>" style="display: inline-block;" class="button button-fill" >查看电子票</a>
					  </span>
					  </div>
					</div><?php endforeach; endif; ?>
			 </div>
			 		<?php if($stay_participate_show): ?><div class="infinite-scroll-preloader" id="not_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_not_submit();" class="not_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					<?php else: ?>
					<p id="load_more"> 暂无数据！</p><?php endif; ?>
			</div>
			
			
			<div class="tab" id="order_4">
				<div id="complete_activity">
					<?php if(is_array($complete)): foreach($complete as $k=>$complete): ?><div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> <?php echo ($complete['sponsor']); ?></span>
					  <a>
					  	 已完成
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="<?php echo U('orderDetail',array('order_id'=>$complete['id']));?>">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="<?php echo ($complete['activity_img']); ?>" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title"><?php echo ($complete['activity_name']); ?></div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo ($complete['area']); ?>&nbsp;&nbsp;&nbsp;<?php echo ($complete['signup_number']); ?>人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo (date("Y-m-d",$complete['start_time'])); ?> 至 <?php echo (date("Y-m-d",$complete['end_time'])); ?></p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font><?php echo ($complete['amount']); ?></font></span>
					  <span>
					  <a href="<?php echo U('Users/orderDetail',array('order_id'=>$complete['id']));?>" style="display: inline-block;" class="button button-fill" >查看</a>
					  </span>
					  </div>
					</div><?php endforeach; endif; ?>
			 </div>
			 		<?php if($complete_show): ?><div class="infinite-scroll-preloader" id="complete_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_complete_submit();" class="complete_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					<?php else: ?>
					<p id="load_more"> 暂无数据！</p><?php endif; ?>
			</div>
			
			
			<div class="tab" id="order_5">
				<div id="cancel_activity">
					<?php if(is_array($cancel)): foreach($cancel as $k=>$cancel): ?><div class="card user_order_card">
					  <div class="card-header"><span><span class="iconfont icon-huiyuan1"></span> <?php echo ($cancel['sponsor']); ?></span>
					  <a>
					  	 已取消
					  </a>
					  </div>
					  <div class="card-content">
					  <a href="<?php echo U('orderDetail',array('order_id'=>$cancel['id']));?>">
					    <div class="list-block media-list">
					      <ul>
					        <li class="item-content">
					          <div class="item-media">
					            <img src="<?php echo ($cancel['activity_img']); ?>" style="width:100px;" />
					          </div>
					          <div class="item-inner">
					            <div class="item-title-row">
					              <div class="item-title"><?php echo ($cancel['activity_name']); ?></div>
					            </div>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo ($cancel['area']); ?>&nbsp;&nbsp;&nbsp;<?php echo ($cancel['signup_number']); ?>人已报名</p>
					            <p style="font-size:12px;margin:0 0;" class="color-gray"><?php echo (date("Y-m-d",$cancel['start_time'])); ?> 至 <?php echo (date("Y-m-d",$cancel['end_time'])); ?></p>
					          </div>
					        </li>
					      </ul>
					    </div>
					  </a>
					  </div>
					  <div class="card-footer"><span>￥<font><?php echo ($cancel['amount']); ?></font></span>
					  <span>
					  <a href="<?php echo U('Users/orderDetail',array('order_id'=>$cancel['id']));?>" style="display: inline-block;" class="button button-fill" >查看</a>
					  </span>
					  </div>
					</div><?php endforeach; endif; ?>
			 </div>
			 		<?php if($cancel_show): ?><div class="infinite-scroll-preloader" id="complete_quan" style="display:none;">
						<div class="preloader"></div>
					 </div>
					<p onclick="ajax_sourch_cancel_submit();" class="cancel_more" id="load_more"><span class="icon icon-down"></span> 点击加载更多...</p>
					<?php else: ?>
					<p id="load_more"> 暂无数据！</p><?php endif; ?>
			</div>
			
			
			
			</div>
		</div>
		</div>
		<div class="page" id="order_page">
			<div class="bar bar-nav">
				<h1 class="title">订单详情</h1>
				<i class="icon icon-left" onclick="window.history.go(-1);"></i>
			</div>
			<nav class="bar bar-tab ticket-tab">
				<a class="tab-item" href="publish_1.html">
					<span class="icon iconfont icon-add"></span>
					<span class="tab-label">我要发布活动</span>
				</a>
				<a class="tab-item open-3-modal">
					<span class="icon icon-check"></span>
					<span class="tab-label">完成活动</span>
				</a>
			</nav>
			<div class="content">
				<div class="list-block ticket">
				    <ul>
				    	<li class="item-content">
					        <div class="item-inner">
					          <p class="item-title">免费票<span>￥0.00</span></p>
					        </div>
				      	</li>
				      	<li class="item-content">
					        <div class="item-inner text-center">
					        	<div class="item-title ticket_img">
					        		<h3>0005 4654 4561</h3>
					        		<img src="/Public/Home/activity/img/img_01.jpg" >
					        		<p>待参与</p>
					        	</div>
					        </div>
				      	</li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title text-center" style="width:100%">活动名称活动名称活动名称活动名称活动名称</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">主办方:</div>
					          <div class="item-after">时虹时期中国</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">时　间:</div>
					          <div class="item-after">2017-08-31</div>
					        </div>
				        </li>
				        <li class="item-content">
					        <div class="item-inner">
					          <div class="item-title">地　点:</div>
					          <div class="item-after">广州市天河区黄埔大道55555号</div>
					        </div>
				        </li>
				    </ul>
				  </div>
			</div>
		</div>
		
		

		<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
		<script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
		<script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
		<script src="http://idangero.us/swiper/dist/js/swiper.min.js"></script>
		<script type="text/javascript" src="/Public/Home/activity/js/huodon.js" ></script>
		<script>
			
			var swiper = new Swiper('.swiper-container', {
				pagination: '.swiper-pagination',
				paginationClickable: true,
				loop:true,    
				grabCursor: true,
				autoplay: 3000
			});
			
			 /* $(document).on('click','.open-preloader', function () {
				 Zepto.showPreloader('加载中...')
				    setTimeout(function () {
				    	 Zepto.hidePreloader();
				    }, 2000); 
			 }); */
			 $(document).on('click','.open-indicator', function () {
				 Zepto.showIndicator();
			     setTimeout(function () {
			    	Zepto.hideIndicator();
			     }, 2000);
			  });
		</script>
		

	</body>

</html>

<script>
var  page = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_submit()
 {	 	 	 
	 	$("#all_quan").show();
        page += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/all_order/is_ajax/1/p/"+page,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#all_quan").hide();
				if($.trim(data) == ''){
					$('.all_more').hide();
				}else{
				    $("#all_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_stay = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_stay_submit()
 {	 	 	 
	 	$("#stay_quan").show();
	 	page_stay += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/stay_order/is_ajax/1/p/"+page_stay,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#stay_quan").hide();
				if($.trim(data) == ''){
					$('.stay_more').hide();
				}else{
				    $("#stay_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_not = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_not_submit()
 {	 	 	 
	 	$("#not_quan").show();
	 	page_stay += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/stay_participate_order/is_ajax/1/p/"+page_stay,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#not_quan").hide();
				if($.trim(data) == ''){
					$('.not_more').hide();
				}else{
				    $("#not_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_complete = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_complete_submit()
 {	 	 	 
	 	$("#complete_quan").show();
	 	page_complete += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/complete_order/is_ajax/1/p/"+page_complete,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#complete_quan").hide();
				if($.trim(data) == ''){
					$('.complete_more').hide();
				}else{
				    $("#complete_activity").append(data);
				}
			}
		}); 
 } 
 
 var  page_cancel = 1;
 /*** ajax 提交表单 查询订单列表结果*/  
 function ajax_sourch_cancel_submit()
 {	 	 	 
	 	$("#cancel_quan").show();
	 	page_cancel += 1;
		$.ajax({
			type : "GET",
			//url:"/index.php?m=Mobile&c=User&a=collect_list&is_ajax=1&p="+page,//+tab,			
			url:"/Users/cancel_order/is_ajax/1/p/"+page_cancel,//+tab,
//			data : $('#filter_form').serialize(),// 你的formid 搜索表单 序列化提交
			success: function(data)
			{
				$("#cancel_quan").hide();
				if($.trim(data) == ''){
					$('.cancel_more').hide();
				}else{
				    $("#cancel_activity").append(data);
				}
			}
		}); 
 }
 
</script>

		<script>
			Zepto(document).on('click','.open-3-modal', function () {
			    Zepto.modal({
			      title:  '进行中，确定己经参与了本活动吗？',
			      text: '',
			      buttons: [
			        {
			          text: '取消',
			          onClick: function() {
			          }
			        },
			        {
			          text: '确定',
			          color:'danger',
			          onClick: function() {
			          }
			        },
			      ]
			    })
		    });
		</script>
		<style>
			.modal-title{font-size:.75rem;}
			.modal-inner{background:#fff;}
			.modal-button{height:2rem;background:#fff;line-height:2rem;font-size:.625rem;}
			.modal-button:first-child{color:#0894ec;}
			.modal-button:last-child{color:#0894ec;}
		</style>
	</body>

</html>